Partial reloading in data synchronization

ABSTRACT

Partial reloading of source data in data synchronization. Determining whether a source partition of source data in a source database is to be reloaded into target data in a target database, the source partition corresponding to a target partition of the target data. In accordance with a determination that the source partition is to be reloaded, one or more processors determine to load the source partition from the source database into the target database as a reference partition, the reference partition being separated from the target data in the target database and being assigned with a reference partition identity. In accordance with a determination that the loading of the source partition is completed, one or more processors determine to attach the reference partition to the target data.

BACKGROUND

The present disclosure generally relates to database query techniquesand more particularly, to a method, system, and computer program productfor partial reloading in data synchronization.

Databases are computerized information storage and retrieval systems.The most prevalent type of database is the relational database, atabular database in which data is defined so that it can be reorganizedand accessed in a number of different ways. Another type of database isa distributed database that can be dispersed or replicated amongdifferent points in a network. Given the rapidly expanding volume ofdata under management, companies also continue to seek innovativetechniques for managing data growth, in addition to protecting data. Forinstance, solutions providing data analysis capabilities, improved datapresentation and access features, data synchronization, and the like,are in increasing demand.

SUMMARY

According to one embodiment of the present invention, there is provideda computer-implemented method. According to the method, one or moreprocessors determine whether a source partition of source data in asource database is to be reloaded into target data in a target database,the source partition corresponding to a target partition of the targetdata. In accordance with a determination that the source partition is tobe reloaded, one or more processors determine load the source partitionfrom the source database into the target database as a referencepartition, the reference partition being separated from the target datain the target database and being assigned with a reference partitionidentity. In accordance with a determination that the loading of thesource partition is completed, one or more processors determine attachthe reference partition to the target data.

According to a further embodiment of the present invention, there isprovided a system. The system comprises a processing unit; and a memorycoupled to the processing unit and storing instructions thereon. Theinstructions, when executed by the processing unit, perform acts of themethod according to the embodiment of the present invention.

According to a yet further embodiment of the present invention, there isprovided a computer program product being tangibly stored on anon-transient machine-readable medium and comprising machine-executableinstructions. The instructions, when executed on a device, cause thedevice to perform acts of the method according to the embodiment of thepresent invention.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS

Through the more detailed description of some embodiments of the presentdisclosure in the accompanying drawings, the above and other objects,features and advantages of the present disclosure will become moreapparent, wherein the same reference generally refers to the samecomponents in the embodiments of the present disclosure.

FIG. 1 depicts a cloud computing node according to some embodiments ofthe present disclosure;

FIG. 2 depicts a cloud computing environment according to someembodiments of the present disclosure;

FIG. 3 depicts abstraction model layers according to some embodiments ofthe present disclosure;

FIG. 4 depicts a block diagram of a database environment according tosome embodiments of the present disclosure;

FIG. 5 depicts an example conventional process of access to target datawith a plurality of partitions;

FIGS. 6A-6D depicts an example environment in which partial reloading ofsome embodiments of the present disclosure are implemented;

FIG. 7 an example of query execution according to some embodiments ofthe present disclosure; and

FIG. 8 depicts a flowchart of an example process according to someembodiments of the present disclosure.

DETAILED DESCRIPTION

Some embodiments of the present invention will be described in moredetail with reference to the accompanying drawings, in which theembodiments have been illustrated. However, embodiments of the presentinvention can be implemented in various manners, and thus should not beconstrued to be limited to the embodiments disclosed herein.

It is to be understood that although this disclosure includes a detaileddescription on cloud computing, implementation of the teachings recitedherein are not limited to a cloud computing environment. Rather,embodiments of the present invention are capable of being implemented inconjunction with any other type of computing environment now known orlater developed.

Cloud computing is a model of service delivery for enabling convenient,on-demand network access to a shared pool of configurable computingresources (e.g. networks, network bandwidth, servers, processing,memory, storage, applications, virtual machines, and services) that canbe rapidly provisioned and released with minimal management effort orinteraction with a provider of the service. This cloud model may includeat least five characteristics, at least three service models, and atleast four deployment models.

Characteristics are as follows:

On-demand self-service: a cloud consumer can unilaterally provisioncomputing capabilities, such as server time and network storage, asneeded automatically without requiring human interaction with theservice's provider.

Broad network access: capabilities are available over a network andaccessed through standard mechanisms that promote use by heterogeneousthin or thick client platforms (e.g., mobile phones, laptops, and PDAs).

Resource pooling: the provider's computing resources are pooled to servemultiple consumers using a multi-tenant model, with different physicaland virtual resources dynamically assigned and reassigned according todemand. There is a sense of location independence in that the consumergenerally has no control or knowledge over the exact location of theprovided resources but may be able to specify location at a higher levelof abstraction (e.g., country, state, or datacenter).

Rapid elasticity: capabilities can be rapidly and elasticallyprovisioned, in some cases automatically, to quickly scale out andrapidly released to quickly scale in. To the consumer, the capabilitiesavailable for provisioning often appear to be unlimited and can bepurchased in any quantity at any time.

Measured service: cloud systems automatically control and optimizeresource use by leveraging a metering capability at some level ofabstraction appropriate to the type of service (e.g., storage,processing, bandwidth, and active user accounts). Resource usage can bemonitored, controlled, and reported providing transparency for both theprovider and consumer of the utilized service.

Service Models are as follows:

Software as a Service (SaaS): the capability provided to the consumer isto use the provider's applications running on a cloud infrastructure.The applications are accessible from various client devices through athin client interface such as a web browser (e.g., web-based e-mail).The consumer does not manage or control the underlying cloudinfrastructure including network, servers, operating systems, storage,or even individual application capabilities, with the possible exceptionof limited user-specific application configuration settings.

Platform as a Service (PaaS): the capability provided to the consumer isto deploy onto the cloud infrastructure consumer-created or acquiredapplications created using programming languages and tools supported bythe provider. The consumer does not manage or control the underlyingcloud infrastructure including networks, servers, operating systems, orstorage, but has control over the deployed applications and possiblyapplication hosting environment configurations.

Infrastructure as a Service (IaaS): the capability provided to theconsumer is to provision processing, storage, networks, and otherfundamental computing resources where the consumer is able to deploy andrun arbitrary software, which can include operating systems andapplications. The consumer does not manage or control the underlyingcloud infrastructure but has control over operating systems, storage,deployed applications, and possibly limited control of select networkingcomponents (e.g., host firewalls).

Deployment Models are as follows:

Private cloud: the cloud infrastructure is operated solely for anorganization. It may be managed by the organization or a third party andmay exist on-premises or off-premises.

Community cloud: the cloud infrastructure is shared by severalorganizations and supports a specific community that has shared concerns(e.g., mission, security requirements, policy, and complianceconsiderations). It may be managed by the organizations or a third partyand may exist on-premises or off-premises.

Public cloud: the cloud infrastructure is made available to the generalpublic or a large industry group and is owned by an organization sellingcloud services.

Hybrid cloud: the cloud infrastructure is a composition of two or moreclouds (private, community, or public) that remain unique entities butare bound together by standardized or proprietary technology thatenables data and application portability (e.g., cloud bursting forload-balancing between clouds).

A cloud computing environment is service oriented with a focus onstatelessness, low coupling, modularity, and semantic interoperability.At the heart of cloud computing is an infrastructure that includes anetwork of interconnected nodes.

Referring now to FIG. 1, a schematic of an example of a cloud computingnode is shown. Cloud computing node 10 is only one example of a suitablecloud computing node and is not intended to suggest any limitation as tothe scope of use or functionality of embodiments of the disclosuredescribed herein. Regardless, cloud computing node 10 is capable ofbeing implemented and/or performing any of the functionality set forthhereinabove.

In cloud computing node 10 there is a computer system/server 12 or aportable electronic device such as a communication device, which isoperational with numerous other general purpose or special purposecomputing system environments or configurations. Examples of well-knowncomputing systems, environments, and/or configurations that may besuitable for use with computer system/server 12 include, but are notlimited to, personal computer systems, server computer systems, thinclients, thick clients, hand-held or laptop devices, multiprocessorsystems, microprocessor-based systems, set top boxes, programmableconsumer electronics, network PCs, minicomputer systems, mainframecomputer systems, and distributed cloud computing environments thatinclude any of the above systems or devices, and the like.

Computer system/server 12 may be described in the general context ofcomputer system-executable instructions, such as program modules, beingexecuted by a computer system. Generally, program modules may includeroutines, programs, objects, components, logic, data structures, and soon that perform particular tasks or implement particular abstract datatypes. Computer system/server 12 may be practiced in distributed cloudcomputing environments where tasks are performed by remote processingdevices that are linked through a communications network. In adistributed cloud computing environment, program modules may be locatedin both local and remote computer system storage media including memorystorage devices.

As shown in FIG. 1, computer system/server 12 in cloud computing node 10is shown in the form of a general-purpose computing device. Thecomponents of computer system/server 12 may include, but are not limitedto, one or more processors or processing units 16, a system memory 28,and a bus 18 that couples various system components including systemmemory 28 to processor 16.

Bus 18 represents one or more of any of several types of bus structures,including a memory bus or memory controller, a peripheral bus, anaccelerated graphics port, and a processor or local bus using any of avariety of bus architectures. By way of example, and not limitation,such architectures include Industry Standard Architecture (ISA) bus,Micro Channel Architecture (MCA) bus, Enhanced ISA (EISA) bus, VideoElectronics Standards Association (VESA) local bus, and PeripheralComponent Interconnect (PCI) bus.

Computer system/server 12 typically includes a variety of computersystem readable media. Such media may be any available media that isaccessible by computer system/server 12, and it includes both volatileand non-volatile media, removable and non-removable media.

System memory 28 can include computer system readable media in the formof volatile memory, such as random access memory (RAM) 30 and/or cachememory 32. Computer system/server 12 may further include otherremovable/non-removable, volatile/non-volatile computer system storagemedia. By way of example only, storage system 34 can be provided forreading from and writing to a non-removable, non-volatile magnetic media(not shown and typically called a “hard drive”). Although not shown, amagnetic disk drive for reading from and writing to a removable,non-volatile magnetic disk (e.g., a “floppy disk”), and an optical diskdrive for reading from or writing to a removable, non-volatile opticaldisk such as a CD-ROM, DVD-ROM or other optical media can be provided.In such instances, each can be connected to bus 18 by one or more datamedia interfaces. As will be further depicted and described below,memory 28 may include at least one program product having a set (e.g.,at least one) of program modules that are configured to carry out thefunctions of embodiments of the disclosure.

Program/utility 40, having a set (at least one) of program modules 42,may be stored in memory 28 by way of example, and not limitation, aswell as an operating system, one or more application programs, otherprogram modules, and program data. Each of the operating system, one ormore application programs, other program modules, and program data orsome combination thereof, may include an implementation of a networkingenvironment. Program modules 42 generally carry out the functions and/ormethodologies of embodiments of the disclosure as described herein.

Computer system/server 12 may also communicate with one or more externaldevices 14 such as a keyboard, a pointing device, a display 24, etc.;one or more devices that enable a user to interact with computersystem/server 12; and/or any devices (e.g., network card, modem, etc.)that enable computer system/server 12 to communicate with one or moreother computing devices. Such communication can occur via Input/Output(I/O) interfaces 22. Still yet, computer system/server 12 cancommunicate with one or more networks such as a local area network(LAN), a general wide area network (WAN), and/or a public network (e.g.,the Internet) via network adapter 20. As depicted, network adapter 20communicates with the other components of computer system/server 12 viabus 18. It should be understood that although not shown, other hardwareand/or software components could be used in conjunction with computersystem/server 12. Examples, include, but are not limited to: microcode,device drivers, redundant processing units, external disk drive arrays,RAID systems, tape drives, and data archival storage systems, etc.

Referring now to FIG. 2, illustrative cloud computing environment 50 isdepicted. As shown, cloud computing environment 50 includes one or morecloud computing nodes 10 with which local computing devices used bycloud consumers, such as, for example, personal digital assistant (PDA)or cellular telephone 54A, desktop computer 54B, laptop computer 54C,and/or automobile computer system 54N may communicate. Nodes 10 maycommunicate with one another. They may be grouped (not shown) physicallyor virtually, in one or more networks, such as Private, Community,Public, or Hybrid clouds as described hereinabove, or a combinationthereof. This allows cloud computing environment 50 to offerinfrastructure, platforms and/or software as services for which a cloudconsumer does not need to maintain resources on a local computingdevice. It is understood that the types of computing devices 54A-N shownin FIG. 2 are intended to be illustrative only and that computing nodes10 and cloud computing environment 50 can communicate with any type ofcomputerized device over any type of network and/or network addressableconnection (e.g., using a web browser).

Referring now to FIG. 3, a set of functional abstraction layers providedby cloud computing environment 50 (FIG. 2) is shown. It should beunderstood in advance that the components, layers, and functions shownin FIG. 3 are intended to be illustrative only and embodiments of thedisclosure are not limited thereto. As depicted, the following layersand corresponding functions are provided:

Hardware and software layer 60 includes hardware and softwarecomponents. Examples of hardware components include: mainframes 61; RISC(Reduced Instruction Set Computer) architecture based servers 62;servers 63; blade servers 64; storage devices 65; and networks andnetworking components 66. In some embodiments, software componentsinclude network application server software 67 and database software 68.

Virtualization layer 70 provides an abstraction layer from which thefollowing examples of virtual entities may be provided: virtual servers71; virtual storage 72; virtual networks 73, including virtual privatenetworks; virtual applications and operating systems 74; and virtualclients 75.

In one example, management layer 80 may provide the functions describedbelow. Resource provisioning 81 provides dynamic procurement ofcomputing resources and other resources that are utilized to performtasks within the cloud computing environment. Metering and Pricing 82provide cost tracking as resources are utilized within the cloudcomputing environment, and billing or invoicing for consumption of theseresources. In one example, these resources may include applicationsoftware licenses. Security provides identity verification for cloudconsumers and tasks, as well as protection for data and other resources.User portal 83 provides access to the cloud computing environment forconsumers and system administrators. Service level management 84provides cloud computing resource allocation and management such thatrequired service levels are met. Service Level Agreement (SLA) planningand fulfillment 85 provides pre-arrangement for, and procurement of,cloud computing resources for which a future requirement is anticipatedin accordance with an SLA.

Workloads layer 90 provides examples of functionality for which thecloud computing environment may be utilized. Examples of workloads andfunctions which may be provided from this layer include: mapping andnavigation 91; software development and lifecycle management 92; virtualclassroom education delivery 93; data analytics processing 94;transaction processing 95; and partial data reloading 96. Thefunctionalities of partial data reloading 96 will be described in thefollowing embodiment of the present invention.

FIG. 4 illustrates a block diagram of a database environment 400. In theenvironment 400, a data management system 410 is configured to performdata management on a source database 420 with source data 422 storedtherein and a target database 430 with source data 432 stored therein.Typically, the two databases may build on massive storage devices. Thedatabases may be any suitable type of databases, including a relationaldatabase or non-relational database. In some scenarios, the source data422 is also called as a source data table, and the target data 432 isalso called as a target data table.

In some embodiments, the data management system 410 may be implementedby computer system/server 12 of FIG. 1 or by multiple computersystems/servers in a distributed manner. In particular, the datamanagement system 410 supports operations on the databases 420 and 430.

Initially, the target data 432 is loaded from the source data 422. Oneor more users may operate on the source data 422, and at least a partthereof may be changed. For example, more data entries may be added tothe source data 422, some data entries of the source data 422 may bedeleted or modified. It is expected that the target data 432 issynchronized with the source data 422.

Since the source data 422 may be of large size, to performsynchronization of the source data 422 and the target data 432, it ispossible to perform partial reloading. To perform partial reloading, thesource data 422 and the target data 432 are each divided into aplurality of partitions. The dividing of the partitions may be performedaccording to various criteria as required in different applications. Forexample, for a data table recording user account information from allover the country, a partition of the data table may include user accountinformation from a province of the country. The partial reloadingmechanism allows refreshing some partitions of the source data 422 intothe target data 432, which is more convenient and time-efficient.

During operation, in order to access, retrieve, and process the storedtarget data 432, a query 405 is generated, automatically or manually.The term “query” refers to a set of commands for retrieving data from astored database. In the case of a relational database, the standardprotocol is the structured query language (SQL), and thus the query 405is a SQL query. SQL is used for interactive queries to access the datain the database, in order to select, insert, update, find out thelocation of data in a database, and so forth. The data management system410 receives and processes the query 405 in order to execute it.

Generally, to access data in a database, the data management system maydefine a “view” to capture a part of target data to be accessed.Currently, a view is defined by a where clause which specifies thecolumn name in the target data as the query condition. In order toaccess one or more partitions of the target data, the data managementsystem may determine one or more column names in the one or morepartitions to be accessed and generate the corresponding where clause.The data management system may use a predicate language for the whereclause. FIG. 5 illustrates an example conventional data access process500 to target data with a plurality of partitions. It is assumed thattarget data 505 includes partitions P1, P2, P3, P4, P5, . . . , PN, anda query is received to access data in partitions P1, P2, and P3.

During the data access process, to generate an execution plan for thepredicate execution langue, it is not possible to exclude otherpartitions such as partitions P4, P5, . . . , PN from the executionplan. Thus, all the partitions of the target data 505 are locked and anoperation of “Table_Scan” 520 is executed to scan all the target data505 by identifying the identity of the target data in operation “TABLE:TAB_1” 530. The scan operation is executed to find the column namescorresponding to the desired partitions P1, P2, and P3. After theoperation of “Table_Scan,” the found column names are returned as aresponse to the query, via an operation of ROW_RETURN″ 510.

Currently, to perform the partial reloading, one or more partitions ofthe target data are first deleted and corresponding partitions of thesource data are copied and inserted into the target data in the targetdatabase.

The partial reloading may replace all data of one or more specifiedpartitions into the target data. At the same time, concurrent queriesare possible on the target data. Those queries need run with snapshotisolation semantics as it is desired that the customers initiating thequeries can see the data entirely either before or after the partialreloading.

Although the partial reloading is more time-efficient as compared withthe full reloading, as the data volume become larger and larger, thepartial reloading elapsed time may become longer and longer. In somecases, the execution of the queries may have to be stopped during thepartial reloading process because old-of-date data are needed to bedeleted at the beginning of the process. Further, there may be impactsexisting between cleaning up out-of-date data and concurrent customers'queries on the same target data.

Therefore, there is a need for effective partial reloading in datasynchronization.

According to example embodiments of the present invention, or presentdisclosure, there is a proposed solution for effective data access. Inthis solution, instead of copying a source partition from source dataand inserting the copied data to target data, the source partition isloaded from the source database and stored in a target databaseseparately from the target data. The source partition is stored as areference partition in the target database. After the loading iscompleted, the reference partition is attached to the target data. Thepartial reloading process, which may take a certain period of time, willhave no impact on the queries to the target data because the loadingpartition is separated from the target data. Further, unlike theinserting operation, the attaching operation will not cause a commitimpact on the target database because no rollback is needed for theattaching operation.

Other advantages of the present disclosure will be described withreference to the example embodiments and the accompanying drawingsbelow.

Reference is first made to FIG. 6A, which illustrates an exampleenvironment in which partial reloading of some embodiments of thepresent disclosure are implemented. For the purpose of illustration, theenvironment of FIG. 6A is evolved from the environment 400 in FIG. 4.FIG. 6A illustrates some embodiments of partial reloading from thesource data 422 to the target data 432. Further reference will be madeto FIGS. 6B, 6C, and 6D to illustrate further example operations duringpartial reloading

To better illustrate the embodiments of the present disclosure, as shownin FIG. 6A, the source data 422 in the source database 420 includes aplurality of source partitions such as a source partition 622-1 (denotedas P1), a source partition 622-2 (denoted as P2), and so on. The targetdata 432 in the target database 430 includes a plurality of targetpartitions corresponding to the source partitions of the source data422. Specifically, the target data 432 includes a target partition 634-1(denoted as P100001) corresponding to the source partition 622-1, atarget partition 634-2 (denoted as P100002) corresponding to the sourcepartition 634-2, and so on.

It would be appreciated that the number of source partitions and targetpartitions in FIG. 6A are provided example, and the source data andtarget data may include other numbers of partitions. For convenience ofdiscussion, the source partitions 622-1, 622-2 may be collectively orindividually referred to as source partitions 622, and the targetpartitions 634-1, 634-2 may be collectively or individually referred toas target partitions 634.

The target partitions in the target database 430 may be previouslyloaded from the source data 422 through all possible manners. Forexample, in an initial stage, the source data 422 may be fully loadedfrom the source database 420 to the target database 430. In such case,the target partition 634-1 is loaded 603 from the source partition632-1, and the target partition 634-1 is loaded 605 from the sourcepartition 632-2, and so on. In some other examples, the targetpartitions 634 may be loaded through a partial reloading process.

In some embodiments, the target database 430 may further includesrespective incremental replication (IR) partitions corresponding thetarget partitions, including an IR partition 632-1 corresponding to thetarget partition 634-1, an IR partition 632-2 corresponding to thetarget partition 634-2, and so on. For convenience of discussion, the IRpartitions 632-1, 632-2 may be collectively or individually referred toas IR partitions 632. The respective IR partitions 632 storesincremental data for the target partitions 634 through an incrementalreplication process. For example, after the target partitions 634 areloaded from the source partitions 632, the source partitions 632 storedin the source database 420 may be updated with incremental data.

The incremental data corresponding to each source partition 622 may beloaded into the IR partitions 632. For example, incremental data in thesource partition 622-1 is loaded 602 into the IR partition 632-1,incremental data in the source partition 622-2 is loaded 604 into the IRpartition 632-2, and so on. As such, an IR partition 632 and a targetpartition 634 can include the latest data in a corresponding sourcepartition 622.

During operation, a partial reload process may be initiated, trying toreload a source partition 622 of the source data 422 in the sourcedatabase 420 to the target database 640. The partial reloading may betriggered for various reasons. For example, the partial reloading may betriggered periodically, in response to some events, or manually by theoperators.

The partial reloading is to reload all data in a source partition 622-2(instead of the incremental data only) to the target data 432 in thetarget database 430, in order to maintain data synchronization betweenthe partitions of the source data 422 and the target data 432. During apartial reloading processed, one, some, or all of the source partitions622 of the source data 422 may be reloaded to the target data 432. Inthe example of FIG. 6A, it is assumed that a source partition 622-2 isto be reloaded into the target database 430. The partial reloading ofthe source partition 622-2 is described in detail and the partialreloading of other source partitions may be performed in a similar way.

According to the embodiments of the present disclosure, the partialreloading may be implemented at the data management system 410. If thedata management system 410 determines to reload the source partition622-2 to the target data 432, the data management system 410 loads 611the source partition 622-2 from the source database 420 to the targetdatabase 430 as a reference partition 636. The source partition 622-2 iscorresponding to the target partition 634-2. The reference partition 636is to be loaded to the target database 430 as separate data 438, storedseparately from the target data 432. For example, the target data 432 isstored as a target data table and the reference partition 636 is storedas a separate data table.

The loading of the source partition 622-2 from the source database 420to the target database 430 may take some time. The time lapse of theloading may depends on the size of the source partition 622-3 amongothers. If the loading of the source partition is completed, which meansthat data in the source partition 622-2 has been completely stored inthe target database 430, the data management system 410 attaches 612 thereference partition 636 to the target database 430, for example, throughan “attach” operation provided by the target database 430. As thereference partition 636 has been stored in the target database, theattaching operation can be completed quickly. In addition, unlike theinserting operation, the attaching operation will not cause a commitimpact on the target database because no rollback is needed for theattaching operation.

During the loading of the source partition 622-2, the data managementsystem 410 may respond to the queries involving the target data 432normally, including the queries involving the target partition 634-2which corresponds to the source partition 622-2. This target partition634-2 is remained in the target data 432 without changes. That is, theloading of the source partition 622-2 will not impact on the performanceto the queries.

Specifically, in some embodiments of the present disclosure, there isproposed a solution for the execution of queries. The partitions of thetarget data 432 are each assigned with respective partition identities.As illustrated in FIG. 6A, the target partition 634-1 is assigned with apartition name “P100001” and a global partition object identity “125.”The partition name may distinguish the target partition 634-1 from otherpartitions in the target data 432, and the global partition objectidentity may distinguish this partition from all the other partitionsstored in the target database 430. Similarly, the target partition 634-2is assigned with a partition name “P100002” and a global partitionobject identity “126.” The IR partition 622-1 is assigned with apartition name “P1” and a global partition object identity “123” and theIR partition 622-2 is assigned with a partition name “P2” and a globalpartition object identity “124.”

The partition identities of the partitions may enable the datamanagement system 410 to perform access to the respective partitions ofthe target data, without locking the all the target data during theaccess to a part thereof. From the applications issuing queries to oneor more partitions of the target data 432, the partitions of the wholetarget data 432 may be viewed through a list of its partitionsidentified with their partition identities. For example, the datamanagement system 410 may create a view using partition list clause 650.A view 652 may be presented with one or more partitions of the targetdata 432, such as partitions 1, 2, 100001, and/ 100002.

Specifically, during the loading of the source partition 622-1, if thedata management system 410 receives a query 405 to at least the targetpartition 634-2, the data management system 410 may generate anexecution plan for the query 405. In the execution plan, the targetpartition 643-1 may be identified with its target partition identity,including “P100001” and/or “126.” In some embodiments, to access thelatest data, the execution plan for the query 405 may further identifythe IR partition 632-2 with its partition identity “P1” and/or “124.”

In some embodiments, if the target database 430 supports accessing thetarget data by creating a view, the execution plan may define a viewassociated with the target partition 634-2 by identifying the targetpartition 634-2 with the target partition identity “P100001” and/or“126.” In some cases, the view may be further defined by identifying thecorresponding IR partition 632-2 with its partition identity “P1” and/or“124.” By executing the execution plan, the target partition 634-2 andits IR partition 632-2 may be locked and scanned during the access. Thedata to be queried in the target partition 634-2 and its IR partition632-2 may be found and returned as a response to the query 405.

It is noted that if the query 405 involves one or more partitions otherthan the target partition 634-2, the execution plan may define the viewby identifying the one or more other partitions in a similar way.

FIG. 7 illustrates an example of query execution according to someembodiments of the present disclosure. In this example, it is assumedthat the target data 432 includes partitions P1, P2, P3, P4, P5, . . . ,PN (more partitions than those shown in FIG. 6A), and a query isreceived to access data in partitions P1, P2, and P3 of the target data.The data management system 410 may generate an execution plan for thisquery by creating a view to identify partitions P1, P2, and P3 withtheir identities (with partition names P1, P2, P3, and global partitionobject identities 223, 224, 225 in the example of FIG. 7). Clauses 742,744, 746 are executed to identify partitions P1, P2, and P3, andoperations of “Partition Scan” 732, 734, 736 are performed to find datain partitions P1, P2, and P3 that are to be searched in the currentquery. The results from partitions P1, P2, and P3 are combined throughan operation of “Partition_Combine” 720. The column names in thepartitions P1, P2, and P3 are returned as a response to the query, viaan operation of ROW_RETURN″ 710.

Through the above execution plan, the partitions in the target data 432can be accessed normally during loading of the source partition 622 andeven during the attaching of the reference partition 636. To support thequeries to the reference partition 636, the reference partition 636 isalso assigned with a reference partition identity, such as a partitionname “P100003” and/or a global partition object identity “127.”

After the reference partition 636 is attached to the target data 432, itis expected to remove old data from the target data 432. Reference ismade back to FIG. 6B, which illustrates that the reference partition 636is included in the target data 432. The data management system 410 maydetach 613 the IR partition 632-2 corresponding to the target partition634-2 from the target data 432, for example, through a “detach”operation provided by the target database 430. The incremental datastored in the IR partition 632-2 has been incorporated in the referencepartition 636 which is loaded from the source database 420 and thus maybe removed now.

Through the detaching operation, a copy 642 of the IR partition 632-2 isgenerated and stored separately from the target data 432. For example,the copy 642 of the IR partition 632-2 may be stored as a separate datatable in the target database 430. The copy 642 of the IR partition 632-2may inherit the partition identities of the IR partition 632-2.

In addition to the detaching of the IR partition 632-2, the datamanagement system 410 may further an empty IR partition 644 in thetarget database 430, which is assigned with a further partitionidentity, such as a partition name “P2” and a new global partitionobject identity “128.” It is noted that the same partition name “P2” asthe IR partition 632-2 can be used because the IR partition 632-2 isdetached from the target data 432. The data management system 410 maythen attach 614 the empty IR partition 644 to the target data 432 tostore following incremental data for the reference partition 636 (whichis corresponding to the source partition 622-2 in the source data 422).

In some embodiments, the data management system 410 may further detach615 the target partition 634-2 from the target data 432, for example,through a “detach” operation provided by the target database 430.Through the detaching operation, a copy 646 of the target partition634-2 is generated and stored separately from the target data 432 in thetarget database 430. For example, the copy 646 of the target partition634-2 may be stored as a separate data table in the target database 430.The copy 646 of the target partition 634-2 may inherit the partitionidentities of the target partition 634-2.

Through the above detaching and attaching process, the data in thetarget database 430 may be as illustrated in FIG. 6C. By providing thecopy 642 of the IR partition 632-2 and the copy 646 of the targetpartition 634-2 after the reference partition 636 is included to thetarget data 432, it is possible to support pending queries which addressto the IR partition 632-2 and the target partition 634-2. For example,the data management system 410 may determine whether there is a pendingexecution plan identifying the target partition 634-2 with the targetpartition identity “P100002” and “126” and/or identifying the IRpartition 632-2 with the target partition identity “P2” and “124.” Ifthere is such a pending execution plan, the copy 642 of the IR partition632-2 and the copy 646 of the target partition 634-2 may be accessed toprovide the response to the query.

In some embodiments, if there is no such pending execution plan, thedata management system 410 may delete the copy 642 of the IR partition632-2 and the copy 646 of the target partition 634-2. During thedeletion of the IR partition 632-2 and the target partition 634-2, theaccess to the target data 432 can be executed without performancedegradation. After the deletion, the target data 432 in the targetdatabase 430 may include the IR partition 622-1, the IR partition 644,and the target partition 624-1, and the reference partition 636 which isa new reloaded version for the previous target partition 624-2, asillustrated in FIG. 6D.

In some embodiments, after the reference partition 636 is included tothe target data 432, and sometimes after the empty IR partition 644 isattached to the target data 432, from the applications issuing queriesto one or more partitions of the target data 432, the partitions of thewhole target data 432 may be viewed through a list of its partitionsidentified with their partition identities. For example, the datamanagement system 410 may create a view using partition list clause 560.A view 654 may be presented with one or more partitions of the targetdata 432, such as partitions 1, 2, 100001, and/ 100003.

If a query 660 is received and the query 660 involving at least thetarget partition 634-2 is received, the data management system 410 maydirect the query 660 to the latest data corresponding to the targetpartition 634-2. Specifically, the data management system 410 maygenerate an execution plan for the second query by identifying thereference partition 636 with the reference partition identity (P100003,127). The execution plan may be generated as discussed above. The datamanagement system 410 may execute the execution plan to provide aresponse to the query 660.

FIG. 8 shows a flowchart of an example method 800 according to someembodiments of the present disclosure. The method 800 can be implementedat the database management system 410 of FIG. 4. For the purpose ofdiscussion, the method 800 will be described from the perspective of thedatabase management system 410 with reference to FIGS. 6A-6D.

At block 810, the database management system 410 determines, whether asource partition of source data in a source database is to be reloadedinto target data in a target database, the source partitioncorresponding to a target partition of the target data. If the sourcepartition is to be reloaded, At block 820, the database managementsystem 410 loads the source partition from the source database into thetarget database as a reference partition, the reference partition beingseparated from the target data in the target database and being assignedwith a reference partition identity. At block 830, the databasemanagement system 410 determines whether the loading of the sourcepartition is completed. If the loading of the source partition is nocompleted, the database management system 410 continues to perform theloading. If the loading of the source partition is completed, at block840, the database management system 410 attaches the reference partitionto the target data.

In some embodiments, in accordance with a determination that a firstquery to at least the target partition is received during the loading ofthe source partition, the database management system 410 generates afirst execution plan for the first query, the first execution planidentifying the target partition with a target partition identity; andexecutes the first execution plan to provide a first response to thefirst query.

In some embodiments, the first execution plan defines a view associatedwith the target partition by identifying the target partition with thetarget partition identity.

In some embodiments, the database management system 410 detaches thetarget partition from the target data, the target partition being storedin the target database and being separated from the target data.

In some embodiments, the database management system 410 determineswhether there is a pending execution plan identifying the targetpartition with the target partition identity; and in accordance with adetermination that there is no pending execution plan identifying thetarget partition with the target partition identity, deletes the targetpartition from the target database.

In some embodiments, in accordance with a determination that a secondquery to the target partition is received after the attaching of thereference partition, the database management system 410 generates asecond execution plan for the second query, the second execution planidentifying the reference partition with the reference partitionidentity; and executes the second execution plan to provide a secondresponse to the second query.

In some embodiments, the target data further comprises an incrementalreplication partition for the target partition, the method furthercomprising: the database management system 410 detaches the incrementalreplication partition from the target data, the incremental replicationpartition being stored in the target database and being separated fromthe target data; generates an empty incremental replication partition inthe target database, the empty incremental replication partition beingassigned with a further partition identity; and attaches the emptyincremental replication partition to the target data to storeincremental data for the reference partition.

In some embodiments, the management system 410 determines whether thereis a pending execution plan identifying the incremental replicationpartition with an incremental replication partition identity; and inaccordance with a determination that there is no pending execution planidentifying the incremental replication partition with the incrementalreplication partition identity, deletes the incremental replicationpartition from the target database.

It should be noted that the data management system 410 according toembodiments of this disclosure could be implemented by computersystem/server 12 of FIG. 1.

The present disclosure may be a system, a method, and/or a computerprogram product at any possible technical detail level of integration.The computer program product may include a computer readable storagemedium (or media) having computer readable program instructions thereonfor causing a processor to carry out aspects of the present disclosure.

The computer readable storage medium can be a tangible device that canretain and store instructions for use by an instruction executiondevice. The computer readable storage medium may be, for example, but isnot limited to, an electronic storage device, a magnetic storage device,an optical storage device, an electromagnetic storage device, asemiconductor storage device, or any suitable combination of theforegoing. A non-exhaustive list of more specific examples of thecomputer readable storage medium includes the following: a portablecomputer diskette, a hard disk, a random access memory (RAM), aread-only memory (ROM), an erasable programmable read-only memory (EPROMor Flash memory), a static random access memory (SRAM), a portablecompact disc read-only memory (CD-ROM), a digital versatile disk (DVD),a memory stick, a floppy disk, a mechanically encoded device such aspunch-cards or raised structures in a groove having instructionsrecorded thereon, and any suitable combination of the foregoing. Acomputer readable storage medium, as used herein, is not to be construedas being transitory signals per se, such as radio waves or other freelypropagating electromagnetic waves, electromagnetic waves propagatingthrough a waveguide or other transmission media (e.g., light pulsespassing through a fiber-optic cable), or electrical signals transmittedthrough a wire.

Computer readable program instructions described herein can bedownloaded to respective computing/processing devices from a computerreadable storage medium or to an external computer or external storagedevice via a network, for example, the Internet, a local area network, awide area network and/or a wireless network. The network may comprisecopper transmission cables, optical transmission fibers, wirelesstransmission, routers, firewalls, switches, gateway computers and/oredge servers. A network adapter card or network interface in eachcomputing/processing device receives computer readable programinstructions from the network and forwards the computer readable programinstructions for storage in a computer readable storage medium withinthe respective computing/processing device.

Computer readable program instructions for carrying out operations ofthe present disclosure may be assembler instructions,instruction-set-architecture (ISA) instructions, machine instructions,machine dependent instructions, microcode, firmware instructions,state-setting data, configuration data for integrated circuitry, oreither source code or object code written in any combination of one ormore programming languages, including an object oriented programminglanguage such as Smalltalk, C++, or the like, and procedural programminglanguages, such as the “C” programming language or similar programminglanguages. The computer readable program instructions may executeentirely on the user's computer, partly on the user's computer, as astand-alone software package, partly on the user's computer and partlyon a remote computer or entirely on the remote computer or server. Inthe latter scenario, the remote computer may be connected to the user'scomputer through any type of network, including a local area network(LAN) or a wide area network (WAN), or the connection may be made to anexternal computer (for example, through the Internet using an InternetService Provider). In some embodiments, electronic circuitry including,for example, programmable logic circuitry, field-programmable gatearrays (FPGA), or programmable logic arrays (PLA) may execute thecomputer readable program instructions by utilizing state information ofthe computer readable program instructions to personalize the electroniccircuitry, in order to perform aspects of the present disclosure.

Aspects of the present disclosure are described herein with reference toflowchart illustrations and/or block diagrams of methods, apparatus(systems), and computer program products according to embodiments of thedisclosure. It will be understood that each block of the flowchartillustrations and/or block diagrams, and combinations of blocks in theflowchart illustrations and/or block diagrams, can be implemented bycomputer readable program instructions.

These computer readable program instructions may be provided to aprocessor of a computer, or other programmable data processing apparatusto produce a machine, such that the instructions, which execute via theprocessor of the computer or other programmable data processingapparatus, create means for implementing the functions/acts specified inthe flowchart and/or block diagram block or blocks. These computerreadable program instructions may also be stored in a computer readablestorage medium that can direct a computer, a programmable dataprocessing apparatus, and/or other devices to function in a particularmanner, such that the computer readable storage medium havinginstructions stored therein comprises an article of manufactureincluding instructions which implement aspects of the function/actspecified in the flowchart and/or block diagram block or blocks.

The computer readable program instructions may also be loaded onto acomputer, other programmable data processing apparatus, or other deviceto cause a series of operational steps to be performed on the computer,other programmable apparatus or other device to produce a computerimplemented process, such that the instructions which execute on thecomputer, other programmable apparatus, or other device implement thefunctions/acts specified in the flowchart and/or block diagram block orblocks.

The flowchart and block diagrams in the Figures illustrate thearchitecture, functionality, and operation of possible implementationsof systems, methods, and computer program products according to variousembodiments of the present disclosure. In this regard, each block in theflowchart or block diagrams may represent a module, segment, or portionof instructions, which comprises one or more executable instructions forimplementing the specified logical function(s). In some alternativeimplementations, the functions noted in the blocks may occur out of theorder noted in the Figures. For example, two blocks shown in successionmay, in fact, be accomplished as one step, executed concurrently,substantially concurrently, in a partially or wholly temporallyoverlapping manner, or the blocks may sometimes be executed in thereverse order, depending upon the functionality involved. It will alsobe noted that each block of the block diagrams and/or flowchartillustration, and combinations of blocks in the block diagrams and/orflowchart illustration, can be implemented by special purposehardware-based systems that perform the specified functions or acts orcarry out combinations of special purpose hardware and computerinstructions.

The descriptions of the various embodiments of the present disclosurehave been presented for purposes of illustration, but are not intendedto be exhaustive or limited to the embodiments disclosed. Manymodifications and variations will be apparent to those of ordinary skillin the art without departing from the scope and spirit of the describedembodiments. The terminology used herein was chosen to best explain theprinciples of the embodiments, the practical application or technicalimprovement over technologies found in the marketplace, or to enableothers of ordinary skill in the art to understand the embodimentsdisclosed herein.

Some helpful definitions follow:

Present invention/Present disclosure: should not be taken as an absoluteindication that the subject matter described by the term “presentinvention” or “present disclosure” is covered by either the claims asthey are filed, or by the claims that may eventually issue after patentprosecution; while the term is used to help the reader to get a generalfeel for which disclosures herein that are believed as maybe being new,this understanding, as indicated by use of the term is tentative andprovisional and subject to change over the course of patent prosecutionas relevant information is developed and as the claims are potentiallyamended.

Embodiment: see definition of “present invention” above—similar cautionsapply to the term “embodiment.”

and/or: inclusive or; for example, A, B “and/or” C means that at leastone of A or B or C is true and applicable.

User/subscriber: includes, but is not necessarily limited to, thefollowing: (i) a single individual human; (ii) an artificialintelligence entity with sufficient intelligence to act as a user orsubscriber; and/or (iii) a group of related users or subscribers.

Module/Sub-Module: any set of hardware, firmware and/or software thatoperatively works to do some kind of function, without regard to whetherthe module is: (i) in a single local proximity; (ii) distributed over awide area; (iii) in a single proximity within a larger piece of softwarecode; (iv) located within a single piece of software code; (v) locatedin a single storage device, memory or medium; (vi) mechanicallyconnected; (vii) electrically connected; and/or (viii) connected in datacommunication.

Computer: any device with significant data processing and/or machinereadable instruction reading capabilities including, but not limited to:desktop computers, mainframe computers, laptop computers,field-programmable gate array (FPGA) based devices, smart phones,personal digital assistants (PDAs), body-mounted or inserted computers,embedded device style computers, application-specific integrated circuit(ASIC) based devices.

What is claimed is:
 1. A computer-implemented method comprising: determining whether a source partition of source data in a source database is to be reloaded into target data in a target database, the source partition corresponding to a target partition of the target data; in accordance with a determination that the source partition is to be reloaded, loading the source partition from the source database into the target database as a reference partition, the reference partition being separated from the target data in the target database and being assigned with a reference partition identity; in accordance with a determination that the loading of the source partition is completed, attaching the reference partition to the target data; in accordance with a determination that a first query to the target partition is received after the attaching of the reference partition, generating a first execution plan for the first query, the first execution plan identifying the reference partition with the reference partition identity; and executing the first execution plan to provide a first response to the first query.
 2. The method of claim 1, further comprising: in accordance with a determination that a second query to at least the target partition is received during the loading of the source partition, generating, by one or more processors, a second execution plan for the second query, the second execution plan identifying the target partition with a target partition identity; and executing, by one or more processors, the second execution plan to provide a second response to the second query.
 3. The method of claim 2, wherein the second execution plan defines a view associated with the target partition by identifying the target partition with the reference partition identity.
 4. The method of claim 1, further comprising: detaching, by one or more processors, the target partition from the target data, the target partition being stored in the target database and being separated from the target data.
 5. The method of claim 4, further comprising: determining, by one or more processors, whether there is a pending execution plan identifying the target partition with the target partition identity; and in accordance with a determination that there is no pending execution plan identifying the target partition with the target partition identity, deleting, by one or more processors, the target partition from the target database.
 6. The method of claim 1, wherein the target data further comprises an incremental replication partition for the target partition, the method further comprising: detaching, by one or more processors, the incremental replication partition from the target data, the incremental replication partition being stored in the target database and being separated from the target data; generating, by one or more processors, an empty incremental replication partition in the target database, the empty incremental replication partition being assigned with a further partition identity; and attaching, by one or more processors, the empty incremental replication partition to the target data to store incremental data for the reference partition.
 7. The method of claim 6, further comprising: determining, by one or more processors, whether there is a pending execution plan identifying the incremental replication partition with an incremental replication partition identity; and in accordance with a determination that there is no pending execution plan identifying the incremental replication partition with the incremental replication partition identity, deleting, by one or more processors, the incremental replication partition from the target database.
 8. A computer system comprising: a processing unit; and a memory coupled to the processing unit and storing instructions thereon, the instructions, when executed by the processing unit, performing acts comprising: determining whether a source partition of source data in a source database is to be reloaded into target data in a target database, the source partition corresponding to a target partition of the target data; in accordance with a determination that the source partition is to be reloaded, loading the source partition from the source database into the target database as a reference partition, the reference partition being separated from the target data in the target database and being assigned with a reference partition identity; in accordance with a determination that the loading of the source partition is completed, attaching the reference partition to the target data; in accordance with a determination that a first query to the target partition is received after the attaching of the reference partition, generating a first execution plan for the first query, the first execution plan identifying the reference partition with the reference partition identity; and executing the first execution plan to provide a first response to the first query.
 9. The computer system of claim 8, wherein the acts further comprise: in accordance with a determination that a second query to at least the target partition is received during the loading of the source partition, generating, by one or more processors, a second execution plan for the second query, the second execution plan identifying the target partition with a target partition identity; and executing, by one or more processors, the second execution plan to provide a second response to the second query.
 10. The computer system of claim 8, wherein the first execution plan defines a view associated with the target partition by identifying the target partition with the reference partition identity.
 11. The computer system of claim 8, wherein the acts further comprise: detaching the target partition from the target data, the target partition being stored in the target database and being separated from the target data.
 12. The computer system of claim 11, wherein the acts further comprise: determining whether there is a pending execution plan identifying the target partition with the target partition identity; and in accordance with a determination that there is no pending execution plan identifying the target partition with the target partition identity, deleting the target partition from the target database.
 13. The computer system of claim 8, wherein the target data further comprises an incremental replication partition for the target partition, the acts further comprising: detaching the incremental replication partition from the target data, the incremental replication partition being stored in the target database and being separated from the target data; generating an empty incremental replication partition in the target database, the empty incremental replication partition being assigned with a further partition identity; and attaching the empty incremental replication partition into the target data to store incremental data for the reference partition.
 14. A computer program product comprising a computer-readable storage medium having a set of instructions stored therein which, when executed by a processor, causes the processor to perform acts comprising: determining whether a source partition of source data in a source database is to be reloaded into target data in a target database, the source partition corresponding to a target partition of the target data; in accordance with a determination that the source partition is to be reloaded, loading the source partition from the source database into the target database as a reference partition, the reference partition being separated from the target data in the target database and being assigned with a reference partition identity; in accordance with a determination that the loading of the source partition is completed, attaching the reference partition to the target data; in accordance with a determination that a first query to the target partition is received after the attaching of the reference partition, generating a first execution plan for the first query, the first execution plan identifying the reference partition with the reference partition identity; and executing the first execution plan to provide a first response to the first query.
 15. The computer program product of claim 14, wherein the acts further comprise: in accordance with a determination that a second query to at least the target partition is received during the loading of the source partition, generating a second execution plan for the second query, the second execution plan identifying the target partition with a target partition identity; and executing the second execution plan to provide a second response to the second query.
 16. The computer program product of claim 14, wherein the acts further comprise: detaching the target partition from the target data, the target partition being stored in the target database and being separated from the target data.
 17. The computer program product of claim 14, wherein the target data further comprises an incremental replication partition for the target partition, the acts further comprising: detaching the incremental replication partition from the target data, the incremental replication partition being stored in the target database and being separated from the target data; generating an empty incremental replication partition in the target database, the empty incremental replication partition being assigned with a further partition identity; and attaching the empty incremental replication partition into the target data to store incremental data for the reference partition.
 18. The computer system of claim 8, wherein the acts further comprise: determining whether there is a pending execution plan identifying the incremental replication partition with an incremental replication partition identity; and in accordance with a determination that there is no pending execution plan identifying the incremental replication partition with the incremental replication partition identity, deleting the incremental replication partition from the target database.
 19. The computer program product of claim 14, wherein the acts further comprise: determining whether there is a pending execution plan identifying the incremental replication partition with an incremental replication partition identity; and in accordance with a determination that there is no pending execution plan identifying the incremental replication partition with the incremental replication partition identity, deleting the incremental replication partition from the target database.
 20. The computer program product of claim 14, wherein the first execution plan defines a view associated with the target partition by identifying the target partition with the reference partition identity. 